<%@ include file="/inc/top.jsp"%>
<%@ page import="com.novix.portal.framework.util.IConstants"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="lotus.domino.Document"%>
<%@ page import="com.novix.portal.framework.model.impl.WebOrganization"%>
<%@ page import="com.novix.portal.framework.util.UserContainer"%>
<%@ page import="com.novix.portal.framework.model.impl.WebContact"%>
<%
        String link = basePath + "do/domino/viewDetail";
        String companyId=null;
        String catFilter=null;
        String catId=null;
        String compFilter="";
        if(request.getSession().getAttribute("companyFilter")!=null){
	        companyId = (String)request.getSession().getAttribute("companyFilter");
	        compFilter= "companyId="+companyId;
	        }
        if(request.getSession().getAttribute("category")!=null){
	        catId = (String)request.getSession().getAttribute("category");
	        catFilter= "&category="+catId;
	        }
	        
%>

<DIV align="center">

	<%--<a href="<%=basePath%>do/domino/viewContacts?<%=compFilter%><%=catFilter%>">All</A>
--%>
	<br>

	<H4>
		By Last Name
	</H4>
	<%
	if(request.getParameter("boardInvitee")==null){
        for (char letter = 'A'; letter <= 'Z'; letter++) {
            out.print("<a href=" + basePath + "do/domino/viewContacts?lastname=" + letter + "&"+compFilter+catFilter+">" + letter + "</A>&nbsp;&nbsp;&nbsp;");
        }
        %>
	<br>
	<H4>
		By Company Name
	</H4>
	<%
         for (char letter = 'A'; letter <= 'Z'; letter++) {
            out.print("<a href=" + basePath + "do/domino/viewContacts?compname=" + letter + "&"+compFilter+catFilter+">" + letter + "</A>&nbsp;&nbsp;&nbsp;");
        }
        }
    else{
    %>
	<h3>
		Board Invitees
	</h3>
	<%}%>
</DIV>
<html:form action="/domino/viewOrganizations">
	<div align="left" style="margin-left: 100px">

		<logic:empty name="<%=IConstants.SELECTED_COMPANY_CONTACTS_LIST %>">

			<DIV align="left">
				<%if(request.getParameter("lastname")!=null){
				 out.println("No pictures found for users whose last name begins with " + request.getParameter("lastname") +".");
				 }
			 else{
				 out.println("No pictures found.");
			 }
			  %>
			</div>

		</logic:empty>
		<logic:notEmpty name="<%=IConstants.SELECTED_COMPANY_CONTACTS_LIST %>">
			<DIV align="left">
				<%
			//List tList=(List)request.getAttribute(IConstants.SELECTED_COMPANY_CONTACTS_LIST);
			//WebContact contact= (WebContact) tList.get(0);
			//if(contact!=null && contact.getCompanyName()!=null && compFilter!=null)
			//	out.println("Pictures for " + contact.getCompanyName() +"");
			%>
			</div>
			<table>
				<tr>
					<td></td>
				</tr>
				<logic:iterate name="<%=IConstants.SELECTED_COMPANY_CONTACTS_LIST %>" id="elm" scope="request" type="com.novix.portal.framework.model.impl.WebContact" indexId="counter">
					<%if (counter.intValue() % 3 == 0)
	            out.println("<tr>");
    		    %>
					<DIV align="center">
					<td>
						<a href="<%=link%>?id=<%=elm.getId()%>"> <bean:write name="elm" property="imageLinkHtml" filter="false" /></a>
						<br>
						<a href="<%=link%>?id=<%=elm.getId()%>">
							<%=elm.getFullName()%>
						</a>
						<br>
						<bean:write name="elm" property="companyName" />
						<br>
					</td>
					</div>
				</logic:iterate>
				</tr>
			</table>
		</logic:notEmpty>
	</div>
	<input type="hidden" value=<%=request.getParameter("id")%> id="id" name="id">
	<input type="hidden" value=<%=request.getSession().getAttribute("companyFilter")%> id="companyId" name="companyId">
	<input type="hidden" value=<%=request.getSession().getAttribute("category")%> id="category" name="category">
</html:form>

<%@ include file="/inc/footer.jsp"%>
